package lab02.test11;

public class Rectangle implements Printx {

    public  double width;
    public double height;
    //有求面积、求周长的方法
    double area(){
        double area = width * height;
        return area;
    }

    double perimeter(){
        return width * 2 + height * 2;
    }

    @Override
    public void printMyWay() {
        System.out.println("bianchang:" + width + "," + height);
        System.out.println("mianji:" + area());
        System.out.println("zhouchang:" + perimeter());
    }
}
